package cn.glenn._03vehicle.pojo.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.NonNull;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class UserRegParam {
//    @NotNull(message = "用户名不能为空")
    @NotBlank(message = "用户名不能为空")
    @Size(min = 6,max = 10,message = "用户名必须在6-10之间")
    @Pattern(regexp = "^(?:[\\u4e00-\\u9fa5]{1,7}|[a-zA-Z]{1,14})$",message = "不能超过7个中文或14个英文")
    @Schema(description = "用户名",required = true)
    private String username;
    @NotNull(message = "密码不能为空")
    @Schema(description = "密码", required = true)
    @Pattern(regexp = "^(?!^[a-zA-Z]+$)(?!^[0-9]+$)(?!^[\\p{P}]+$)[a-zA-Z0-9\\p{P}]{8,14}$",
            message = "必须是8-14位字母、数字或标点，且至少包含两种类型")
    private String password;
    @NotNull(message = "电子邮件不能为空")
    @Email(message = "邮件格式不正确")
    @Schema(description = "电子邮件", required = true)
    private String email;
    @NotNull(message = "手机号不能为空")
    @Schema(description = "手机号", required = true)
    private String phone;
}
